package ModelLayer;
import java.util.ArrayList;

/**
 * Write a description of class Dvds here.
 * 
 * @author (Danny Melsen) 
 * @version (07.11.12)
 */
public class Dvds
{
    // instance variables - replace the example below with your own
    private int id;
    private String title;
    private String artist;
    private String releaseDate;
    private static int nextId = 0;
    private ArrayList<Copy> copys;

    /**
     * Constructor for objects of class Dvds
     */
    public Dvds(int id, String title, String artist, String releaseDate)
    {
        copys = new ArrayList<Copy>();
        nextId++;
        this.id=nextId;
        this.title=title;
        this.artist=artist;
        this.releaseDate=releaseDate;
        
    }
    
    /**
     * set the id
     */
     public void setId(int id)
     {
         this.id=id;
     }
     
    /**
      * get the id
      */
     public int getId()
     {
         return id;
     }
    
    /**
     * set title
     */
    public void setTitle(String title)
    {
        this.title=title;
    }
    
    /**
     * get title
     */
    public String getTitle()
    {
        return title;
    }
    
    /**
     * set Artist
     */
    public void setArtist(String artist)
    {
        this.artist=artist;
    }
    
    /**
     * get Artist
     */
    public String getArtist()
    {
        return artist;
    }
    
    /**
     * set releaseDate
     */
    public void setReleaseDate(String releaseDate)
    {
        this.releaseDate=releaseDate;
    }
    
    /**
     * get releaseDate
     */
    public String getReleaseDate()
    {
        return releaseDate;
    }
    
    /**
     * add a copy
     */
    public void addCopy(Copy copy)
    {
        if (copys.contains(copy)){
            System.out.println ("the dvd is allready on the list");
        }
            else {
                copys.add(copy);
            }

    }
    
      /**
     * Print information about Dvds
     */
    public void printInformationDvds()
    {
        System.out.println("id :" + id);
        System.out.println("title :" + title);
        System.out.println("artist :" + artist);
        System.out.println("releaseDate :" + releaseDate);

    }
}
